//
// Created by wkm on 2023-12-05.
//

#ifndef MYSYSTEMCLEARNING_JOHNSON_CTR_H
#define MYSYSTEMCLEARNING_JOHNSON_CTR_H

#include "systemc.h"

const int NBITS = 3;

SC_MODULE(johnson_ctr) {
    sc_in<bool> clk, clear;
    sc_out<sc_uint<NBITS> > q;

    void prc_counter();

    SC_CTOR(johnson_ctr) {
        SC_METHOD(prc_counter); //时序逻辑
        sensitive_pos << clk;
        sensitive_neg << clear;
    }
};

#endif //MYSYSTEMCLEARNING_JOHNSON_CTR_H
